package com.atguigu.spzx.feign.user;

import com.atguigu.spzx.model.entity.user.UserAddress;
import com.atguigu.spzx.model.entity.user.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author Mahone
 */
@FeignClient(name = "service-user")
public interface UserFeignClient {
    /**
     * 全局统一鉴权拿到用户信息
     * @param token
     * @return
     */
    @GetMapping("/api/user/userInfo/getCurrentUserInfoByToken/{token}")
    public UserInfo getCurrentUserInfoByToken(@PathVariable String token);

    /**
     * 根据用户id获取订单地址信息
     * @param id
     * @return
     */
    @GetMapping("/api/user/userAddress/getUserAddress/{id}")
    UserAddress getUserAddressById(@PathVariable Long id);
}
